package main

import (
	product2 "awesomeProject2/product"
	"awesomeProject2/write_line"
	"strings"
)

func getTxm() {
	product := openFile()

	names := product2.OpenNameLine("")

	txms := make([]string, 0)
	for _, name := range names {
		txm := "无"
		for _, datum := range product.Data.Data {
			start := strings.Index(datum.Title, "【")
			end := strings.Index(datum.Title, "】")
			s2 := datum.Title[start+3 : end]

			if s2 == name {
				//s := fmt.Sprintf("name = %s,value = %.2f", s2, datum.MinActivePrice)
				txm = datum.BarCode
			}
		}
		println(txm)
		txms = append(txms, txm)
	}
	write_line.WriteLineTxm(txms, "条形码")
}
